package org.dromara.business.controller;

import cn.dev33.satoken.annotation.SaCheckPermission;
import cn.dev33.satoken.annotation.SaIgnore;
import jakarta.validation.constraints.NotNull;
import lombok.RequiredArgsConstructor;
import org.dromara.business.domain.bo.ZjContentManageBo;
import org.dromara.business.domain.bo.ZjFileManageBo;
import org.dromara.business.domain.bo.ZjInfoBo;
import org.dromara.business.domain.vo.ZjContentManageVo;
import org.dromara.business.domain.vo.ZjFileManageVo;
import org.dromara.business.domain.vo.ZjInfoVo;
import org.dromara.business.service.IZjContentManageService;
import org.dromara.business.service.IZjFileManageService;
import org.dromara.business.service.IZjInfoService;
import org.dromara.common.core.domain.R;
import org.dromara.common.mybatis.core.page.PageQuery;
import org.dromara.common.mybatis.core.page.TableDataInfo;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author:le
 * @create: 2025-01-13 17:45
 * @Description:
 */
@Validated
@RequiredArgsConstructor
@RestController
@RequestMapping("/zjIgnore/business/contentManage")
public class ZjIgnoreController {

    private final IZjContentManageService zjContentManageService;

    private final IZjInfoService zjInfoService;

    private final IZjFileManageService zjFileManageService;

    @SaIgnore
    @GetMapping("/manage/list")
    public TableDataInfo<ZjContentManageVo> manageList(ZjContentManageBo bo, PageQuery pageQuery) {
        return zjContentManageService.queryPageList(bo, pageQuery);
    }

    @SaIgnore
    @GetMapping("/manage/{id}")
    public R<ZjContentManageVo> getManageInfo(@NotNull(message = "主键不能为空")
                                        @PathVariable Long id) {
        return R.ok(zjContentManageService.queryById(id));
    }

    @SaIgnore
    @GetMapping("/info/list")
    public TableDataInfo<ZjInfoVo> infoList(ZjInfoBo bo, PageQuery pageQuery) {
        return zjInfoService.queryPageList(bo, pageQuery);
    }

    @SaIgnore
    @GetMapping("/info/{id}")
    public R<ZjInfoVo> getInfo(@NotNull(message = "主键不能为空")
                               @PathVariable Long id) {
        return R.ok(zjInfoService.queryById(id));
    }

    @SaIgnore
    @GetMapping("/fileManage/list")
    public TableDataInfo<ZjFileManageVo> fileManageList(ZjFileManageBo bo, PageQuery pageQuery) {
        return zjFileManageService.queryPageList(bo, pageQuery);
    }

    @SaIgnore
    @GetMapping("/fileManage/{id}")
    public R<ZjFileManageVo> getFileManageInfo(@NotNull(message = "主键不能为空")
                                     @PathVariable Long id) {
        return R.ok(zjFileManageService.queryById(id));
    }
}
